package br.edu.ufcg.embedded.eolica.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public abstract class MySerializableResource {

	protected int id;

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	public boolean equals(Object resource) {
		if (resource != null && resource instanceof MySerializableResource) {
			return id == ((MySerializableResource) resource).id;
		} else
			return false;
	}

	public abstract void read(InputStream arg0) throws IOException;

	public abstract void write(OutputStream arg0) throws IOException;

}
